<?php
namespace app\admin\validate;

use think\Validate;

class User extends Validate
{
    protected $rule = [
        'mobile'=>'require|mobile|unique:user',
        'user_name'=>'require|length:1,20',
        'gender'    => 'require',
        'card_num'  => 'require|length:1,30',
        'card_lvl'  => 'require|length:1,20',
        'remark'    => 'max:500'
    ];
    protected $message = [
        'mobile.require'=>'手机号不能为空',
        'mobile.mobile'=>'手机号格式错误',
        'mobile.unique'=>'该手机号已存在',
        'user_name.require'=>'姓名不能为空',
        'user_name.length'=>'姓名长度不能超过20位',
        'gender.require'=>'请选择性别',
        'card_num.require'=>'卡号不能为空',
        'card_num.length'=>'卡号长度不能超过30位',
        'card_lvl.require'=>'卡级不能为空',
        'card_lv.length'=>'卡级长度不能超过20位',
        'remark.max'=>'备注长度不能超过500位',
    ];
}
